package com.test3;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class Executor {
	
    private static class ExecutorHolder {
        private static ThreadPoolExecutor executor = new ThreadPoolExecutor(
                2,5,300L,
                TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(10),
                new ThreadPoolExecutor.CallerRunsPolicy());
    }
    public static ThreadPoolExecutor get() {
        return ExecutorHolder.executor; }

}
